package top.fzqblog.reflect

/**
 * Created by 抽离 on 2017/8/4 0004.
 */
class A(val p: Int)

var x = 1

//扩展属性
val String.lastChar: Char
    get() = this[this.length - 1]

fun main(args: Array<String>) {
    val prop = A::p
    println(prop.get(A(1))) // prints "1"

    println("华丽分割线：" + "----------------------")

    println(::x.get())
    ::x.set(2)
    println(x)

    println("华丽分割线：" + "----------------------")
    println(String::lastChar.get("abc")) // prints "c"
}

